}
-long arch_memory_op(int op, GUEST_HANDLE(void) arg)
+long arch_memory_op(int op, guest_handle(void) arg)
{
struct xen_reserved_phys_area xrpa;
unsigned long pfn;
}
}
-long subarch_memory_op(int op, GUEST_HANDLE(void) arg)
+long subarch_memory_op(int op, guest_handle(void) arg)
{
struct xen_machphys_mfn_list xmml;
unsigned long mfn;
}
}
-long subarch_memory_op(int op, GUEST_HANDLE(void) arg)
+long subarch_memory_op(int op, guest_handle(void) arg)
{
struct xen_machphys_mfn_list xmml;
l3_pgentry_t l3e;
static long
increase_reservation(
struct domain *d,
- GUEST_HANDLE(xen_ulong) extent_list,
+ guest_handle(ulong) extent_list,
unsigned int nr_extents,
unsigned int extent_order,
unsigned int flags,
static long
populate_physmap(
struct domain *d,
- GUEST_HANDLE(xen_ulong) extent_list,
+ guest_handle(ulong) extent_list,
unsigned int nr_extents,
unsigned int extent_order,
unsigned int flags,
static long
decrease_reservation(
struct domain *d,
- GUEST_HANDLE(xen_ulong) extent_list,
+ guest_handle(ulong) extent_list,
unsigned int nr_extents,
unsigned int extent_order,
unsigned int flags,
static long
translate_gpfn_list(
- GUEST_HANDLE(xen_translate_gpfn_list_t) uop, unsigned long *progress)
+ guest_handle(xen_translate_gpfn_list_t) uop, unsigned long *progress)
{
struct xen_translate_gpfn_list op;
unsigned long i, gpfn, mfn;
return 0;
}
-long do_memory_op(unsigned long cmd, GUEST_HANDLE(void) arg)
+long do_memory_op(unsigned long cmd, guest_handle(void) arg)
{
struct domain *d;
int rc, op, flags = 0, preempted = 0;
int __sync_lazy_execstate(void);
/* Arch-specific portion of memory_op hypercall. */
-long arch_memory_op(int op, GUEST_HANDLE(void) arg);
-long subarch_memory_op(int op, GUEST_HANDLE(void) arg);
+long arch_memory_op(int op, guest_handle(void) arg);
+long subarch_memory_op(int op, guest_handle(void) arg);
#endif /* __ASM_X86_MM_H__ */
* OUT: GMFN bases of extents that were allocated
* (NB. This command also updates the mach_to_phys translation table)
*/
- GUEST_HANDLE(xen_ulong) extent_start;
+ guest_handle(ulong) extent_start;
/* Number of extents, and size/alignment of each (2^extent_order pages). */
unsigned long nr_extents;
domid_t domid;
} xen_memory_reservation_t;
-DEFINE_GUEST_HANDLE(xen_memory_reservation_t);
+define_guest_handle(xen_memory_reservation_t);
/*
* Returns the maximum machine frame number of mapped RAM in this system.
* any large discontiguities in the machine address space, 2MB gaps in
* the machphys table will be represented by an MFN base of zero.
*/
- GUEST_HANDLE(xen_ulong) extent_start;
+ guest_handle(ulong) extent_start;
/*
* Number of extents written to the above array. This will be smaller
*/
unsigned int nr_extents;
} xen_machphys_mfn_list_t;
-DEFINE_GUEST_HANDLE(xen_machphys_mfn_list_t);
+define_guest_handle(xen_machphys_mfn_list_t);
/*
* Returns the base and size of the specified reserved 'RAM hole' in the
/* Base and size of the specified reserved area. */
unsigned long first_gpfn, nr_gpfns;
} xen_reserved_phys_area_t;
-DEFINE_GUEST_HANDLE(xen_reserved_phys_area_t);
+define_guest_handle(xen_reserved_phys_area_t);
/*
* Translates a list of domain-specific GPFNs into MFNs. Returns a -ve error
unsigned long nr_gpfns;
/* List of GPFNs to translate. */
- GUEST_HANDLE(xen_ulong) gpfn_list;
+ guest_handle(ulong) gpfn_list;
/*
* Output list to contain MFN translations. May be the same as the input
* list (in which case each input GPFN is overwritten with the output MFN).
*/
- GUEST_HANDLE(xen_ulong) mfn_list;
+ guest_handle(ulong) mfn_list;
} xen_translate_gpfn_list_t;
-DEFINE_GUEST_HANDLE(xen_translate_gpfn_list_t);
+define_guest_handle(xen_translate_gpfn_list_t);
#endif /* __XEN_PUBLIC_MEMORY_H__ */
#define __XEN_PUBLIC_XEN_H__
#ifdef __XEN__
-#define DEFINE_GUEST_HANDLE(type) struct __guest_handle_ ## type { type *p; }
-#define GUEST_HANDLE(type) struct __guest_handle_ ## type
+#define __define_guest_handle(name, type) \
+ typedef struct { type *p; } __guest_handle_ ## name
#else
-#define DEFINE_GUEST_HANDLE(type)
-#define GUEST_HANDLE(type) type *
+#define __define_guest_handle(name, type) \
+ typedef type * __guest_handle_ ## name
#endif
+#define define_guest_handle(name) __define_guest_handle(name, name)
+#define guest_handle(name) __guest_handle_ ## name
+
#ifndef __ASSEMBLY__
-/* Guest handle for unsigned long pointer. Define a name with no whitespace. */
-typedef unsigned long xen_ulong;
-DEFINE_GUEST_HANDLE(xen_ulong);
-/* Guest handle for arbitrary-type pointer (void *). */
-DEFINE_GUEST_HANDLE(void);
+/* Guest handles for primitive C types. */
+__define_guest_handle(uchar, unsigned char);
+__define_guest_handle(uint, unsigned int);
+__define_guest_handle(ulong, unsigned long);
+define_guest_handle(char);
+define_guest_handle(int);
+define_guest_handle(long);
+define_guest_handle(void);
#endif
#if defined(__i386__)
/* Cast a guest handle to the specified type of handle. */
#define guest_handle_cast(hnd, type) ({ \
type *_x = (hnd).p; \
- (GUEST_HANDLE(type)) { _x }; \
+ (guest_handle(type)) { _x }; \
})
/*
* 'i' [unsigned] {char, int}
* 'l' [unsigned] long
* 'p' pointer (foo *)
- * 'h' guest handle (GUEST_HANDLE(foo))
+ * 'h' guest handle (guest_handle(foo))
*/
unsigned long hypercall_create_continuation(
unsigned int op, const char *format, ...);